package main

/*
#include <stdlib.h>
*/
import "C"
import "unsafe"

import (
	"go-purple/gloox-swig"
)

var refno uint64 = 1234567890
var refmap = make(map[uint64]interface{})

func next_refno() uint64 {
	refno += 1
	return refno
}
func refobj(obj interface{}) {
	refmap[next_refno()] = obj
}

func SwigEnum(gov uintptr) int {
	if false {
		r := int(*(*C.int)((unsafe.Pointer)(gov)))
		return r
	}
	return gloox.SwigEnum(gov)
}

type SwigWrapType interface {
	Swigcptr() uintptr
}

func DeleteSwigEnum(gov SwigWrapType) {
	enump := (*C.int)((unsafe.Pointer)(gov.Swigcptr()))
	C.free((unsafe.Pointer)(enump))
}
